zmena rozliseni obrazovky
Otázka od: Ján Kuchár
19. 9. 2002 16:47
caute
v programu napsanem pres D5 a urcenem pro W2000 pouzivam kod pro
automatickou zmenu rozliseni obrazovky na 800x600 a po ukonceni programu
prepinam rozliseni zpet na puvodni hodnotu, problem je ale v tom, ze kdyz
kodem ktery jsem prilozil prepnu rozliseni obrazovky tak se mi strati lista
windowsu s tlacitkem start a objevy se az po restartu pocitace, tak pokud
nekdo vite co delam spatne tak mi prosim pomozte.
DIK
>procedure NewScreen(stav:boolean);
>var lpDevMode : TDeviceMode;
> Frequency,aResult : integer;
> DC: HDC;
>begin schovej_listu(stav);
> DC := GetDC(0);
> Frequency := GetDeviceCaps(DC, VREFRESH);
> if (Frequency=0) or (Frequency=1) then Frequency:=85;
> ReleaseDC(0, DC);
> EnumDisplaySettings( nil, 0, lpDevMode );
> if stav then begin with lpDevMode do begin dmBitsPerPel := 16;
>
OldFrequencysc:=Frequency;
>
dmPelsWidth := Newwidthsc;
>
dmPelsHeight := Newheightsc;
>
dmDisplayFrequency:=Frequency;
>
dmFields := DM_BITSPERPEL or DM_PELSWIDTH or
>
DM_PELSHEIGHT or DM_DISPLAYFREQUENCY;
> end
> end
> else begin with lpDevMode do begin dmBitsPerPel := 16;
>
dmPelsWidth := Oldwidthsc;
>
dmPelsHeight := Oldheightsc;
>
dmDisplayFrequency:=OldFrequencysc;
>
dmFields := DM_BITSPERPEL or DM_PELSWIDTH or
>
DM_PELSHEIGHT or DM_DISPLAYFREQUENCY;
> end
> end;
> aResult := ChangeDisplaySettings( lpDevMode, 0 );
>end;